package com.zl.tby.vo;

import com.zl.tby.model.TbyVillagePerson;
import lombok.Data;
import org.noear.solon.validation.annotation.NotNull;

/**
 * 村庄人口bean
 * @author sunjiaxing
 * @version 1.0
 * @since 2024/8/22 00:28
 */
@Data
public class TbyVillagePersonForm {

    /**主键id*/
    private Long id;
    /**村庄id*/
    @NotNull(message = "村庄名称不能为空")
    private Long villageId;
    /**年份*/
    @NotNull(message = "年份")
    private String year;
    /**户籍人口*/
    @NotNull(message = "户籍人口不能为空")
    private Long registeredPopulation;
    /**常住人口*/
    @NotNull(message = "常住人口不能为空")
    private Long permanentPopulation;
    /**劳动力*/
    @NotNull(message = "劳动力不能为空")
    private Long labourForce;

    public TbyVillagePerson createEntity() {
        TbyVillagePerson entity = new TbyVillagePerson();
        entity.setVillageId(this.getVillageId());
        entity.setYear(this.getYear());
        entity.setRegisteredPopulation(this.getRegisteredPopulation());
        entity.setPermanentPopulation(this.getPermanentPopulation());
        entity.setLabourForce(this.getLabourForce());
        return entity;
    }

    public void updateEntity(TbyVillagePerson entity) {
        entity.setVillageId(this.getVillageId());
        entity.setYear(this.getYear());
        entity.setRegisteredPopulation(this.getRegisteredPopulation());
        entity.setPermanentPopulation(this.getPermanentPopulation());
        entity.setLabourForce(this.getLabourForce());
    }
}
